
//给定两个字符串表示两个非负整数num1 和 num2，返回两数乘积，也用字符串表示
//不考虑乘积是否会大于int的最大值

public class Test3 {
    public static void main(String[] args) {
        //准备两个字符串
        String str1 = "12345";
        String str2 = "123";

        //将两个字符串转换成数字
        int num1 = 0;
        int num2 = 0;

        for (int i = 0; i < str1.length(); i++) {
            char c = str1.charAt(i);
            num1 = num1 * 10 + (c - 48);
        }

        for (int i = 0; i < str2.length(); i++) {
            char c = str2.charAt(i);
            num2 = num2 * 10 + (c - 48);
        }

//        System.out.println(num1);
//        System.out.println(num2);
        //乘积
        int sum = num1 * num2;

        String str = sum + "";
        System.out.println(str);
    }
}
